<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>测试</title>

  <style>

  </style>
</head>

<body>
  <button>点击发送请求</button>
</body>
<!-- <script src="./防抖debounce.js"></script> -->
<script src="./节流throttle.js"></script>
<!-- <script src="./手写Promise.js"></script> -->
<!-- <script src="./事件绑定&冒泡.js"></script> -->
<!-- <script src="./事件代理.js"></script> -->
<!-- <script src="./手写ajax.js"></script> -->
<script>
  var arr = [
    [1, 2, 2],
    [3, 4, 5, 7],
    [6, 5, 8, 9, [11, 12, [12, 12, [13]]]],
    10
  ]

  // 思路：递归 + Array.concat
  function flat (arr) {
    return arr.reduce((acc, item) => {
      // console.log(item)
      return acc.concat(Array.isArray(item) ? flat(item) : item)
    }, [])
  }
  console.log(flat(arr))
</script>
<!-- <script src="./class继承.js"></script> -->

</html>
